home *** CD-ROM | disk | FTP | other *** search
- //===========================================================================
- // This file was modified as part of an ASP.NET 2.0 Web project conversion.
- // The class name was changed and the class modified to inherit from the abstract base class
- // in file 'App_Code\Migrated\public\Stub_download_aspx_cs.cs'.
- // During runtime, this allows other classes in your web application to bind and access
- // the code-behind page using the abstract base class.
- // The associated content page 'public\download.aspx' was also modified to refer to the new class name.
- // For more information on this code pattern, please refer to http://go.microsoft.com/fwlink/?LinkId=46995
- //===========================================================================
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Text;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
-
- namespace gbweb
- {
- /// <summary>
- /// Summary description for Download.
- /// </summary>
- public partial class Migrated_PublicDownload : PublicDownload
- {
-
- protected void Page_Load(object sender, System.EventArgs e)
- {
-
- bool direct = Request.Params["mode"] != null;
-
- int rid;
- if (Request.Params["rid"] != null)
- {
- try
- {
- rid = (int)Deseralize(Request.Params["rid"]);
- }
- catch
- {
- return;
- }
- }
- else
- {
- return;
- }
-
- string path = null;
- if (Request.Params["path"] != null)
- {
- try
- {
- path = (string)Deseralize(Request.Params["path"]);
- }
- catch
- {
- return;
- }
- }
-
- Download.ProcessDownload(Request, Response, direct, rid, path);
- }
-
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- }
- #endregion
-
- private static string macKeyModifier;
-
- // static PublicDownload()
- static Migrated_PublicDownload()
- {
- Random rnd = new Random();
- byte[] buffer = new byte[16];
- rnd.NextBytes(buffer);
- macKeyModifier = Encoding.ASCII.GetString(buffer);
- }
-
-
- // public static string Serialize(object value)
- // {
- // LosFormatter los = new LosFormatter(true, macKeyModifier);
- // MemoryStream stream = new MemoryStream();
- // los.Serialize(stream, value);
- // return Encoding.ASCII.GetString(stream.ToArray()).Replace("+", "-").Replace("/", "_").Replace("=", "*");
- // }
-
- // public static object Deseralize(string input)
- // {
- // LosFormatter los = new LosFormatter(true, macKeyModifier);
- // MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(input.Replace("-", "+").Replace("_", "/").Replace("*", "=")));
- // return los.Deserialize(stream);
- // }
-
- }
- }
-